<%-- 
    Document   : controlManagementActivities
    Created on : May 13, 2012, 1:58:59 AM
    Author     : Minhdz
--%>

<%@page import="java.sql.*"%>
<%@page import="connectDB.ConnectDB"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <%
                                                   ConnectDB obj=new ConnectDB();
                                                   Connection conn=obj.getConnect();
                                                   ResultSet rs;
                                                   String sql="select DISTINCT * from Activities ,UsersActivity,PaymentDetail where Activities.ActivityID=UsersActivity.ActivityID and UsersActivity.UserName='"+request.getSession().getAttribute("loginUserINF") +"' and UsersActivity.PaymentID=PaymentDetail.PaymentID";
                                                   Statement st=conn.createStatement();
                                                   rs=st.executeQuery(sql);
                                                   out.write("<table>");
                                                   out.write("<tr><td>Activity</td><td>Fee</td><td>Action</td></tr>");
                                                   while(rs.next())
                                                                                                         {
                                                       out.write("<tr>");
                                                   out.write("<td width='30%'> <a href='getActivties?id="+rs.getString(1)+"'>"+rs.getString(3)+"</a></td>" );
                                                   out.write("<td>"+rs.getString("PaymentTotal")+"</td>");
                                                   
                                                   out.write("<td width='30%'><a href='CancelActivity?id="+rs.getString(1)+"'>Cancel</a></td>");
                                                   out.write("</tr>");
                                                          }
                                                   out.write("</table>");
                                                        
                                                   %>
    </body>
</html>
